<?php include './application/views/common/zhs_header.php';?>
<?php include './application/views/common/zhs_usercenter_acnt.php';?>
<div class="inv_box w">
<?php include './application/views/common/zhs_usercenter_left.php';?>
  <div class="membd_right">
     <h3 class="membdrg_tit">实名认证-安全绑定</h3>
    <div class="mem_perbox">
    <?php 
	$sex = $v['sex'];
	$cardType = $v['cardType'];
	?>
    <?php if($user['real_status'] == 1){ ?>
      <ul class="perboxul">
         <li><span>真实姓名:</span><p><?php echo $user['realname']; ?></p></li>
         <li><span>性别:</span>
         	<p><?php echo $user['sex']==1?'男':'女'; ?></p>
		</li>
         <li><span>身份证号: </span><p><?php echo $user['card_id']; ?></p></li>
          
         <li><h4 class="red">* 一旦实名认证，不易修改。</h4></li>
      </ul>
    <?php }else{ ?>
    <iframe name="iframe" id="iframe" style="display:none;"></iframe>
<form action="" id="realname_form"  enctype="multipart/form-data" method="post" target="iframe">
		<input type="hidden" name="act" value="submit">
    <ul class="perboxul">
         <li><span><em style="color:red;">*</em>真实姓名:</span><p><input type="text" id="realname" name="realname" value="<?php echo $user['realname']; ?>"></p></li>
         <li><span><em style="color:red;">*</em>性 别:</span>
         	<p><input style="margin-left:10px; float:left;" type="radio" value="1" name="sex" <?php echo $user['sex']!=2 ?"checked='checked'":''; ?>><em style="float:left;">男</em>  
			<input style="margin-left:10px; float:left;" type="radio" value="2" name="sex" <?php echo $user['sex']==2 ?"checked='checked'":''; ?>><em style="float:left;">女</em></p>
		</li>
         <li><span><em style="color:red;">*</em>身份证号: </span><p><input type="text" value="<?php echo $user['card_id']; ?>" id="card_id" name="card_id"></p></li>
          
         <li><a style="margin-left:124px;" class="mebal" href="javascript:submit();">确认</a><a class="mebar" href="javascript:;">取消</a></li>
         <li><h4 class="red">* 为必填项，所有资料均会严格保密。</h4></li>
      </ul>
      </form>
  <script type="text/javascript" charset="utf-8">
<?php if($user['real_status'] != 1){ ?>
$(document).ready(function(){
	getChild(0,'<?php echo isset($user['province'])?$user['province']:''; ?>','province');
	<?php if(isset($user['city']) && $user['city']){ ?>
		getChild('<?php echo $user['province']; ?>','<?php echo $user['city']; ?>','city');
	<?php } ?>
	
	<?php if(isset($user['area']) && $user['area']){ ?>
		getChild('<?php echo $user['city']; ?>','<?php echo $user['area']; ?>','area');
	<?php } ?>
});

<?php } ?>
function getChild(pid, selected,obj){
	$.ajax({
		type: "POST",
		url: "/area/get_option",
		data: "pid="+pid+"&selected="+selected,
		success: function(msg){
			$("#"+obj).html(msg);
		},
		dataType: "text"
	});
}

function submit(){
	document.getElementById('realname_form').submit();
}

function func_bind_code(){
	if($("#is_bind_code").attr("checked")){
		$("#bind_code").removeAttr("readonly");
		$("#bind_code").val("请输入验证码");
		return true;
	}else {
		$("#bind_code").attr("readonly",'true');
		$("#bind_code").val("");
		return false;
	}
}

function submit_bind_code(){
	if(func_bind_code()){
		$.ajax({
			type: "post",
			url: "/user/submit_bind_code/",
			success: function(ret){
				if(ret.info == 1){
					alert("短信发送成功，请查收");
				}else{
					alert(ret.msg);
				}
			},
			dataType: "json"
		});	
	}
}


function func_clear(){
	if($("#bind_code").val()== ""){
		$("#bind_code").val("请输入验证码");
	}
}

function func_add(){
	$("#bind_code").val("");
}

</script>
    <?php }?> 
    </div>
     
  </div>
</div> 

<?php include './application/views/common/zhs_footer.php';?>
<?php include './application/views/common/zhs_right.php';?>

